﻿<UserControl x:Class="Marss.JsonViewer.Views.Layout"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
            xmlns:local="clr-namespace:Marss.JsonViewer.Views"

             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <UserControl.Resources>
        <ResourceDictionary>
            <BooleanToVisibilityConverter x:Key="BoolToVis" />
        </ResourceDictionary>
    </UserControl.Resources>
    <TabControl ItemsSource="{Binding Tabs}" SelectedIndex="0" >
        <TabControl.ItemTemplate>
            <DataTemplate>
                <StackPanel  Orientation="Horizontal">
                    <TextBlock Text="{Binding Header}" />

                    <Image Width="16" Height="20" Source="{Binding HeaderIcon}" ToolTip="{Binding HeaderIconTooltip}"
                            Visibility="{Binding Path=ShowHeaderIcon, Converter={StaticResource BoolToVis}}" />

                </StackPanel>

            </DataTemplate>
        </TabControl.ItemTemplate>
        <TabControl.ContentTemplate>
            <DataTemplate >
                <ContentControl Content="{Binding UserControl}"/>
            </DataTemplate>
        </TabControl.ContentTemplate>
    </TabControl>
</UserControl>

